<?php

	header("Content-Type: text/html;charset=utf-8");

	include("function/_nosql.php"); //

	include("function/function.php");
	include("_include.user.judge.php");
	$search_text = chkstr(trim($_REQUEST['search_text']));
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>会员中心</title>

<link rel="stylesheet" href="css/common.css"/>

<link rel="stylesheet" href="css/sq.css"/>

<script type="text/javascript" src="js/laydate/laydate.js"></script>

</head>

<body>

    <!--top-bar begin-->

	<? include("_include.top.topbar.php") ?>

    <!--top-bar end-->

    <!--banner begin-->

    <? include("_include.user.topbar.php")?>

    <!--banner end-->

    <!--member center-->

    <div class="member-box">

        <div class="content">

			<? include("_include.user.leftnav.php") ?>

            <div class="member-box-r">

                <div class="member-item1">

                    <div class="m-title">会员中心</div>

						<div class="m-search">
						
						<form action="user_active.php" method="post">
						
						<input type="text" name="search_text" class="search-text input_wby" placeholder="输入关键词" value="<?=$search_text?>">
						
						<input type="submit" class="search-send" value="搜 索">
						
						</form>
						
						</div>
						

                </div>

                <div class="member-basic" >

                      <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" style="table-layout:fixed;">

                        <tr>
                          <td width="72" align="center" bgcolor="#FFFFFF">活动ID</td>

                          <td width="75"  align="center" bgcolor="#FFFFFF">活动名称</td>

                          <td width="120"  align="center" bgcolor="#FFFFFF">所属类别</td>

                          <td width="82"  align="center" bgcolor="#FFFFFF">开始时间</td>

                          <td width="101"  align="center" bgcolor="#FFFFFF">结束时间</td>
                          <td width="104"  align="center" bgcolor="#FFFFFF">活动状态</td>
                          <td width="108"  align="center" bgcolor="#FFFFFF">已付款人数</td>
						  <td width="81"  align="center" bgcolor="#FFFFFF">报名信息</td>
						  <td width="109"  align="center" bgcolor="#FFFFFF">操作</td>

                        </tr>

						<?php
								$SQL = "";
//								if($search_text){
//									$idLists = getIdList("kboy_forum_active","id","active_title like '%".$search_text."%'");
//									if(!$idLists){
//										$idLists = 0;
//									}
//								}
								if($search_text){
									$news_sql = "select * from  kboy_forum_active where uid=$kboy_userid and active_model = 0 and active_title like '%".$search_text."%' order by active_top desc,active_state desc, id desc";
								}else{
									$news_sql = "select * from  kboy_forum_active where uid=$kboy_userid and active_model = 0 order by active_top desc,active_state desc, id desc";
								}
								$news_rows = mysql_query($news_sql);

								while($news_rs = mysql_fetch_array($news_rows)){

						?>

                        <tr>

                          <td bgcolor="#FFFFFF"><?=$news_rs['id']?></td>

                          <td bgcolor="#FFFFFF"><?=$news_rs['active_title']?></td>

                          <td bgcolor="#FFFFFF"><?=getClassName("kboy_bigclass","bigclass_cn","id=".$news_rs['active_bigclass'])?></td>

                          <td bgcolor="#FFFFFF"><?=date('Y-m-d',strtotime($news_rs['active_start_time']))?></td>

                          <td bgcolor="#FFFFFF"><?=date('Y-m-d',strtotime($news_rs['active_end_time']))?></td>

                          <td bgcolor="#FFFFFF">

						  <?php

						  		if($news_rs['active_end_time'] >$THIS_TODAY_DATETIME){

									echo "进行中";

								}else{

									echo "已结束";

								}

						  ?></td>

                          <td bgcolor="#FFFFFF">

						  <?php
							
						  		$order_sql = "select * from kboy_order where order_state=1 and aid=".$news_rs['id'];

								$order_rows = mysql_query($order_sql);

								while($order_rs = mysql_fetch_array($order_rows))
								{

									echo getUserNickName($order_rs['uid']).",";

								}
								
						  ?>

						  

						  </td>

						  <td bgcolor="#FFFFFF"><a href="user_baoming_list.php?newsid=<?=$news_rs['id'];?>">查看报名列表</a></br>

						  <a href="PHPExcel/Tests/excel.php?newsid=<?=$news_rs['id'];?>" >生成excel</a></br>

						  <a href="PHPExcel/Tests/excel_<?php echo $kboy_userid;?>.xls" >下载报名信息</a></br>

						  </td>

						  <td bgcolor="#FFFFFF"><a href="forum_activeedit.php?uid=<?=$news_rs['uid'];?>&newsid=<?=$news_rs['id'];?>">修改</a> </br>

						  <?php if($news_rs['active_state'] == 0 ){ ?>

						  <a href="forum_activeaddsave.php?action=downline&newsid=<?=$news_rs['id'];?>">下线</a>

						  <?php } ?>

						  <?php if($news_rs['active_state'] == 1 ){ ?>

						  <a href="forum_activeaddsave.php?action=upline&newsid=<?=$news_rs['id'];?>" style="color:#CCC;">已经下线</a>

						  <?php } ?>

						  </td>

                        </tr>

						<?php

						}

						?>

                      </table>

                </div>

            </div>

        </div>

    </div>

    <!--member center-->

    <!--foot begin-->

	<? include("_include.bottom.footbar.php") ?>

    <!--foot begin-->

    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>

    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>

    <script type="text/javascript" src="js/main.js"></script>

    <script type="text/javascript" src="js/sq.js"></script>

</body>

</html>

